import http from './http';
import type {Result,RelVo} from "@/types/api";

export const menuApi = {
    /** 通过角色获取菜单 */
    haveTreeByRole: (roleId: number): Promise<Result<number[]>> => {
        return http.get('/menu/haveTreeByRole', {
            params: { roleId }
        });
    },
    allocationMenu: (rel: RelVo<number, number>): Promise<Result<void>> => {
        return http.post('/menu/allocationMenu', rel)
    }
};